package com.itheima.file;

import java.io.File;
import java.io.IOException;

public class FileDemo03 {
    public static void main(String[] args) throws IOException {
        File file = new File("F:\\IOfile");

        File[] files = file.listFiles();
        for (File path : files) {
            if (path.isDirectory()){
                System.out.println(path.getName()+"是文件夹");
            }else if (path.isFile()){
                System.out.println(path.getName()+"是一个文件");
            }
        }

    }
}
